import React from "react";
import HomeLayout from "./component/layout/home/HomeLayout";
import {homeRoutes} from './route/home';
import {Route, Switch} from "react-router-dom";

function Home() {
	return (
		<HomeLayout>
			<Switch>
				{homeRoutes.map(item => {
					return (
						<Route
							path={item.path}
							key={item.path}
							exact={item.exact}
							render={routeProps => {
								return <item.component
									{...routeProps}
									routes={item.children} />
							}}/>
					)
				})}
			</Switch>
		</HomeLayout>
	);
}

export default Home;